package com.whz.mlc.redis;

import com.whz.generic.spring.SpringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.lang.NonNull;
import org.springframework.util.ErrorHandler;

@Slf4j
public class LogErrorHandler implements ErrorHandler {

    @Override
    public void handleError(@NonNull Throwable t) {
        log.error("redis message listener error.", t);
        SpringUtils.publishEvent(new MessageListenerErrorEvent(t));
    }
}